﻿@{
    Layout = "~/Views/Shared/_FormWhite.cshtml";
}

<div class="wrapper animated fadeInRight">
    <form id="form" class="form-horizontal m">
        <input type="hidden" id="id" name="id" />
        <div class="form-group">
            <label class="col-sm-3 control-label ">字典描述<font class="red"> *</font></label>
            <div class="col-sm-8">
                <input id="remark" name="Remark" type="text" class="form-control" autocomplete="off" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">字典类型<font class="red"> *</font></label>
            <div class="col-sm-8">
                <input id="dictType" name="DictType" type="text" class="form-control"  autocomplete="off"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">字典排序<font class="red"> *</font></label>
            <div class="col-sm-8">
                <input id="dictSort" name="DictSort" type="text" class="form-control" autocomplete="off" />
            </div>
        </div>
    </form>
</div>

<script type="text/javascript">
    $(function () {
        getForm();

        $("#form").validate({
            rules: {
                remark: { required: true },
                dictType: { required: true }
            }
        });
    });

    function getForm() {
        //修改赋值使用
        var editData = storage.get("editData");
        if (editData != null && editData.length > 0) {
            var data = JSON.parse(editData);
            //表单赋值
            $("#form").setWebControls(data);
            $('#menuTree').ysTree("setCheckedNodes", data.menuIds);
        } else {
            //界面初始化 
           var defaultData = {};
           $("#form").setWebControls(defaultData);
        }
    }
    function submitForm() {
        if ($.validate.form()) {
            $.operate.save("/SystemManage/DataDict/SaveFormJson", $('#form').getWebControls());
        }
    }
</script>

